Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containerized auto-generation #829

Merged

Conversation

marquiz
Copy link
Contributor

@marquiz marquiz commented Jun 15, 2022

Run code auto-generation inside a container instead of the host system.
Our auto-generation depends on specific versions of a multitude of tools
(like k8s code-generator, controller-gen, protoc, mockery etc). This
made it really awkward (and error-prone) to run in the host environment,
especially if/when you needed different versions of those tools for
other projects. Making it even more unwieldy, the required versions of
tools were not neatly documented anywhere (except for git commits,
perhaps).

With this patch we have a "fixed environment", as we build a special
auto-generate-builder container which has correct versions of all the
dependencies. Using the container makes auto-generation easy to run
anywhere, independent of the host system, giving reproducibility and
reliability. Also, the patch moves the auto-generation steps out from
the makefile into a separate script, making the makefile cleaner and the
script easier to maintain.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 15, 2022
@k8s-ci-robot k8s-ci-robot requested review from kad and zvonkok June 15, 2022 09:23
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2022
@marquiz marquiz force-pushed the devel/generate-containerized branch 3 times, most recently from 699c4bb to 77299af Compare July 7, 2022 16:21
@marquiz marquiz mentioned this pull request Jul 7, 2022
@marquiz marquiz force-pushed the devel/generate-containerized branch from 77299af to 101f69c Compare July 8, 2022 11:44
@marquiz
Copy link
Contributor Author

marquiz commented Jul 8, 2022

/assign @zvonkok @ArangoGutierrez

@marquiz
Copy link
Contributor Author

marquiz commented Aug 9, 2022

ping @mythi, would you have time to look at this? 😊

A lot of files changed but basically only the first patch is interesting

@marquiz marquiz force-pushed the devel/generate-containerized branch from 101f69c to 585dad5 Compare August 9, 2022 17:20
@ArangoGutierrez
Copy link
Contributor

And what is the use case of this? maybe add some context to the PR description, about the auto-generator tool.

@marquiz marquiz force-pushed the devel/generate-containerized branch from 585dad5 to 856d9f6 Compare August 10, 2022 06:42
Run code auto-generation inside a container instead of the host system.
Our auto-generation depends on specific versions of a multitude of tools
(like k8s code-generator, controller-gen, protoc, mockery etc). This
made it really awkward (and error-prone) to run in the host environment,
especially if/when you needed different versions of those tools for
other projects. Making it even more unwieldy, the required versions of
tools were not neatly documented anywhere (except for git commits,
perhaps).

With this patch we have a "fixed environment", as we build a special
auto-generate-builder container which has correct versions of all the
dependencies. Using the container makes auto-generation easy to run
anywhere, independent of the host system, giving reproducibility and
reliability. Also, the patch moves the auto-generation steps out from
the makefile into a separate script, making the makefile cleaner and the
script easier to maintain.
In order to be able to run it on Go v1.18.
Refresh auto-generated files using the new conainerized approach.
@marquiz marquiz force-pushed the devel/generate-containerized branch from 856d9f6 to ac3030c Compare August 10, 2022 06:47
@marquiz
Copy link
Contributor Author

marquiz commented Aug 10, 2022

And what is the use case of this? maybe add some context to the PR description, about the auto-generator tool.

Oh, I thought it was so obvious 😅 I added a longer commit message (copy-pasted to the PR description). I hope it is easier to understand now.

Copy link
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 10, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, marquiz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit b78f65e into kubernetes-sigs:master Aug 10, 2022
@marquiz marquiz deleted the devel/generate-containerized branch August 10, 2022 11:15
@marquiz marquiz mentioned this pull request Dec 20, 2022
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants